package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.Address;
import com.ruoyi.system.mapper.AddressMapper;
import com.ruoyi.system.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService {
    @Autowired
    private AddressMapper addressMapper;

    @Override
    public Address getByaAddressId(Integer addressId) {
        Address byaAddressId = addressMapper.getByaAddressId(addressId);
        return byaAddressId;
    }

    @Override
    public Integer insertAddress(Address address) {
        Integer integer = addressMapper.insertAddress(address);
        return integer;
    }

    @Override
    public List<Address> getAddressList(Integer userId) {
        List<Address> addressList = addressMapper.getAddressList(userId);
        return addressList;
    }

    @Override
    public Integer deleteById(Integer addressId) {
        Integer integer = addressMapper.deleteById(addressId);
        return integer;
    }
}
